<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/touch.js" charset="utf-8"></script>
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" type="text/css" rel="stylesheet">
	<title>支付密码</title>
    <style type="text/css">
        * {
            outline: none;
            -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
            vertical-align: baseline;
            font-style: normal;
        }

        body {
            margin: 0;
            padding: 0;
            font-size: 12px;
            font-family: Microsoft Yahei, Arial, Simsun, Helvetica, Segoe UI, sans-serif;
            color: #404040;
            background-color: #efeff4;
        }

        img {
            border: 0
        }

        ul, ol, li, dt, dl, dd {
            text-decoration: none;
            list-style: none;
            vertical-align: middle;
            margin: 0;
            padding: 0;
        }

        a,
        a:visited {
            color: #373737;
            text-decoration: none;
        }

        .blank {
            width: 100%;
            height: 20px;
        }
        
.body {background:#ecf0f3;}
.recordMain {width: 100%;background-color: #FFF;display: table;}
.typeNum {text-align:center;margin-top:100px;}
.typeNum .tips {color:#f00;font-size:1.2em;margin-top:20px;}
.password {width:300px;height:50px;border:#ccc 1px solid;font-size:4em;margin-top:20px;display:block;margin-left:auto;margin-right:auto;background:#fff;}
.password span {width:48px;height:50px;border-right:#ccc 1px solid;float:left;}
#lastnum {border:none;}
#othernum {font-size:1.8em;font-family:"黑体";}   
.numkey ul li  div {height:50px;line-height:50px;}
        
</style>


<div id="contentbox">
<div class="typeNum">
  <h2>请输入您的支付密码</h2>
  
  <div class="password">
    <span class="p1"></span>
    <span class="p2"></span>
    <span class="p3"></span>
    <span class="p4"></span>
    <span class="p5"></span>
    <span class="p6" id="lastnum"></span>
  </div>
  <input type="hidden"></input>
  <div class="tips"></div>
    <input type="hidden" name="paypassword">
</div>     
        
                   
<div class="fixednumMain" style="bottom: 0px;">
  
        <div class="numkey">
        <ul class="jianpan">
            <li class="num">
                <div>1</div>
            </li>
            <li class="num">
                <div>2</div>
            </li>
            <li class="num">
                <div>3</div>
            </li>
            <li class="num">
                <div>4</div>
            </li>
            <li class="num">
                <div>5</div>
            </li>
            <li class="num">
                <div>6</div>
            </li>
            <li class="num">
                <div>7</div>
            </li>
            <li class="num">
                <div>8</div>
            </li>
            <li class="num">
                <div>9</div>
            </li>
            <li class="othernum" id="othernum" onclick="javascript:history.go(-1);">取消</li>
            <li class="num" style="line-height: 50px;"><div>0</div></li>
            <li class="delete"></li>
        </ul>
    </div>
</div>                   
</div>
<script type="text/javascript">
$(function(){

	$('.delete').tap(function(){
		var paypassword = $('input[name=paypassword]').val();
		var repaypassword = paypassword.substring(0,paypassword.length-1);

		$('.password span').html('');

		for(var i = 1;i<=paypassword.length-1;i++){
			$('.p'+i).html('*');
		}
		$('input[name=paypassword]').val(repaypassword);
					
	});
	
	$('.jianpan .num').tap(function(){
		var auction_id = '<?php echo $output['auction']['id'];?>';
		var number = $(this).children('div').html();	
		var paypassword = $('input[name=paypassword]').val();
		var auction_price = '<?php echo $_GET['auction_price']?>';
		var totalpay = 	paypassword+number;
		if(totalpay.length>6){
			return false;
		}
		$('input[name=paypassword]').val(totalpay);

		for(var i = 1;i<=totalpay.length;i++){
			$('.p'+i).html('*');
		}
		
		if(totalpay.length==6){
			$.ajax({
				type:'post',
				url:'index.php?act=payment&op=balancepaymentcash',
				data:{auction_id:auction_id,paypasswd:totalpay,auction_price:auction_price},
				dataType:'json',
				success:function(data){
					if(data.state=='1'){
						location.href = 'index.php?act=payment&op=paycashsuccess&auction_id='+'<?php echo $output['auction']['id']?>';	
					}else{
						$('input[name=paypassword]').val('');
						$('.password span').html('');
						$('.tips').html(data.error);	
					}
					return false;
				}
			});
		}
		
	});
});
</script>


</body></html>